home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume11 / catcher / patch1 < prev    next >
Encoding:
Internet Message Format  |  1991-02-14  |  10.7 KB

  1. Path: uunet!lll-winken!sun-barr!newstop!exodus!trantor.harris-atd.com
  2. From: chuck@trantor.harris-atd.com (Chuck Musciano)
  3. Newsgroups: comp.sources.x
  4. Subject: v11i076: catcher - drag and drop manager, Patch1, Part01/01
  5. Message-ID: <8023@exodus.Eng.Sun.COM>
  6. Date: 15 Feb 91 07:34:27 GMT
  7. References: <csx-11i076:catcher@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 334
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: Chuck Musciano <chuck@trantor.harris-atd.com>
  13. Posting-number: Volume 11, Issue 76
  14. Archive-name: catcher/patch1
  15. Patch-To: catcher: Volume 11, Issue 6-10
  16.  
  17.      My apologies to those of you who built catcher only to discover that
  18. it wouldn't even work with the samples I packed with it.  I have since
  19. fixed several minor but fatal bugs, and this patch should give you a
  20. much happier tool.
  21.  
  22.      Catcher is a tool that lets you write scripts which build small windowed
  23. tools that can catch and process "drag and drop" files and text.
  24.  
  25.      Again, my apologies for such a buggy first release.
  26.      
  27. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  28. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  29. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  30. Melbourne, FL 32902            FAX   : (407) 729-3363
  31.  
  32. A good newspaper is never good enough,
  33.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  34.  
  35. #! /bin/sh
  36. # This is a shell archive.  Remove anything before this line, then unpack
  37. # it by saving it into a file and typing "sh file".  To overwrite existing
  38. # files, type "sh file -c".  You can also feed this as standard input via
  39. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  40. # will see the following message at the end:
  41. #        "End of shell archive."
  42. # Contents:  patch
  43. # Wrapped by chuck@melmac on Tue Jan 29 12:41:23 1991
  44. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  45. if test -f 'patch' -a "${1}" != "-c" ; then 
  46.   echo shar: Will not clobber existing file \"'patch'\"
  47. else
  48. echo shar: Extracting \"'patch'\" \(8362 characters\)
  49. sed "s/^X//" >'patch' <<'END_OF_FILE'
  50. X*** Makefile.orig    Tue Jan 29 12:39:44 1991
  51. X--- Makefile    Tue Jan 22 07:32:58 1991
  52. X***************
  53. X*** 43,49 ****
  54. X  install: catcher $(MAN)/catcher.$(MANEXT)
  55. X      cp catcher $(BIN)
  56. X      chmod 755 $(BIN)/catcher
  57. X-     cp catcher.info $(HELPDIR)
  58. X  
  59. X  $(MAN)/catcher.$(MANEXT): catcher.man
  60. X      cp -p catcher.man $(MAN)/catcher.$(MANEXT)
  61. X--- 43,48 ----
  62. X*** Imakefile.orig    Tue Jan 29 12:39:47 1991
  63. X--- Imakefile    Tue Jan 22 07:32:57 1991
  64. X***************
  65. X*** 20,26 ****
  66. X  ComplexProgramTarget(catcher)
  67. X  
  68. X  install:: install.man
  69. X-     $(INSTALL) -c $(INSTMANFLAGS) catcher.info $(HELPDIR)/catcher.info
  70. X  
  71. X  manual:
  72. X      cd doc; make PRINT="$(PRINT)" PRINTER="$(PRINTER)" manual
  73. X--- 20,25 ----
  74. X*** README.orig    Tue Jan 29 12:39:47 1991
  75. X--- README    Tue Jan 29 12:37:00 1991
  76. X***************
  77. X*** 107,109 ****
  78. X--- 107,115 ----
  79. X  *********************************************************************************
  80. X  
  81. X           1.0    16 Jan 91    Original release
  82. X+      
  83. X+          1.0a    29 Jan 91    Patch 1
  84. X+                      Fixed Imakefile
  85. X+                      Corrected bug in parser
  86. X+                      Corrected handling of suffix string
  87. X+                      Renamed ungetc to last_char in lex.c
  88. X*** lex.c.orig    Tue Jan 29 12:39:53 1991
  89. X--- lex.c    Tue Jan 29 12:33:55 1991
  90. X***************
  91. X*** 52,59 ****
  92. X                   {"value",        VALUE},
  93. X                   {"window",       WINDOW_}};
  94. X  
  95. X- 
  96. X- 
  97. X  PRIVATE    struct    {char    first;
  98. X           char    next;
  99. X           int    name;
  100. X--- 52,57 ----
  101. X***************
  102. X*** 73,85 ****
  103. X         curr_file = "stdin";
  104. X         f = stdin;
  105. X         line_count = 1;
  106. X!        ungetc = -1;
  107. X         return(TRUE);
  108. X         }
  109. X      else if (f = fopen(path, "r")) {
  110. X         curr_file = strsave(path);
  111. X         line_count = 1;
  112. X!        ungetc = -1;
  113. X         return(TRUE);
  114. X         }
  115. X      else
  116. X--- 71,83 ----
  117. X         curr_file = "stdin";
  118. X         f = stdin;
  119. X         line_count = 1;
  120. X!        last_char = -1;
  121. X         return(TRUE);
  122. X         }
  123. X      else if (f = fopen(path, "r")) {
  124. X         curr_file = strsave(path);
  125. X         line_count = 1;
  126. X!        last_char = -1;
  127. X         return(TRUE);
  128. X         }
  129. X      else
  130. X***************
  131. X*** 92,99 ****
  132. X  {    register    char    c;
  133. X      static        int    first = TRUE;
  134. X  
  135. X!     if (ungetc != -1)
  136. X!        c = ungetc, ungetc = -1;
  137. X      else if (f == NULL)
  138. X         return(EOF);
  139. X      else {
  140. X--- 90,97 ----
  141. X  {    register    char    c;
  142. X      static        int    first = TRUE;
  143. X  
  144. X!     if (last_char != -1)
  145. X!        c = last_char, last_char = -1;
  146. X      else if (f == NULL)
  147. X         return(EOF);
  148. X      else {
  149. X***************
  150. X*** 182,188 ****
  151. X         *p++ = c;
  152. X         while (isalnum(c = getch()) || c == '_')
  153. X            *p++ = c;
  154. X!        ungetc = c;
  155. X         *p = '\0';
  156. X         temp = strsave(buf);
  157. X         for (p = buf; *p; p++)
  158. X--- 180,186 ----
  159. X         *p++ = c;
  160. X         while (isalnum(c = getch()) || c == '_')
  161. X            *p++ = c;
  162. X!        last_char = c;
  163. X         *p = '\0';
  164. X         temp = strsave(buf);
  165. X         for (p = buf; *p; p++)
  166. X***************
  167. X*** 220,226 ****
  168. X         while (isdigit(c = getch()))
  169. X            *p++ = c;
  170. X         *p = '\0';
  171. X!        ungetc = c;
  172. X         yylval.ival = atoi(buf);
  173. X         RETURN(INTEGER);
  174. X         }
  175. X--- 218,224 ----
  176. X         while (isdigit(c = getch()))
  177. X            *p++ = c;
  178. X         *p = '\0';
  179. X!        last_char = c;
  180. X         yylval.ival = atoi(buf);
  181. X         RETURN(INTEGER);
  182. X         }
  183. X***************
  184. X*** 240,246 ****
  185. X               for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  186. X                  if (c1 == punc[i + j].next)
  187. X                     RETURN(punc[i + j].name);
  188. X!              ungetc = c1;
  189. X               RETURN(punc[i].name);
  190. X               }
  191. X         yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  192. X--- 238,244 ----
  193. X               for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  194. X                  if (c1 == punc[i + j].next)
  195. X                     RETURN(punc[i + j].name);
  196. X!              last_char = c1;
  197. X               RETURN(punc[i].name);
  198. X               }
  199. X         yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  200. X*** parse.y.orig    Tue Jan 29 12:39:58 1991
  201. X--- parse.y    Tue Jan 29 12:33:56 1991
  202. X***************
  203. X*** 30,42 ****
  204. X  
  205. X  EXPORT    int    parse_errors_occured;
  206. X  
  207. X! EXPORT    Catch    config = {NULL, NULL, "Catcher", NULL, '$', '{', '}', NULL, NULL};
  208. X  
  209. X  PRIVATE    char    *get_last_token();
  210. X  
  211. X  PRIVATE    char    *curr_file;
  212. X  PRIVATE    int    line_count = 1;
  213. X! PRIVATE    char    ungetc = -1;
  214. X  
  215. X  PRIVATE    Command    *curr_cmd;
  216. X  PRIVATE    Option    *curr_opt;
  217. X--- 30,42 ----
  218. X  
  219. X  EXPORT    int    parse_errors_occured;
  220. X  
  221. X! EXPORT    Catch    config = {NULL, NULL, "Catcher 1.0a", NULL, '$', '{', '}', NULL, NULL};
  222. X  
  223. X  PRIVATE    char    *get_last_token();
  224. X  
  225. X  PRIVATE    char    *curr_file;
  226. X  PRIVATE    int    line_count = 1;
  227. X! PRIVATE    char    last_char = -1;
  228. X  
  229. X  PRIVATE    Command    *curr_cmd;
  230. X  PRIVATE    Option    *curr_opt;
  231. X***************
  232. X*** 59,66 ****
  233. X  
  234. X  %token        LBRACE RBRACE
  235. X  
  236. X! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE FINISH HORIZONTAL ICON_ ICON_MASK INIT LABEL
  237. X! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER START SUFFIX TEXT TO VALUE WINDOW_
  238. X  
  239. X  %type    <chval>    anon_choice choice
  240. X  %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  241. X--- 59,66 ----
  242. X  
  243. X  %token        LBRACE RBRACE
  244. X  
  245. X! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE HORIZONTAL ICON_ ICON_MASK INIT LABEL
  246. X! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER SUFFIX TEXT TO VALUE WINDOW_
  247. X  
  248. X  %type    <chval>    anon_choice choice
  249. X  %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  250. X***************
  251. X*** 383,389 ****
  252. X  
  253. X  {    char    buf1[1024], buf2[1024];
  254. X  
  255. X!     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((ungetc == '\n')? 1 : 0));
  256. X      sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  257. X      strcat(buf1, buf2);
  258. X      if (strcmp(s1, "syntax error") == 0) {
  259. X--- 383,389 ----
  260. X  
  261. X  {    char    buf1[1024], buf2[1024];
  262. X  
  263. X!     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((last_char == '\n')? 1 : 0));
  264. X      sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  265. X      strcat(buf1, buf2);
  266. X      if (strcmp(s1, "syntax error") == 0) {
  267. X*** patchlevel.h.orig    Tue Jan 29 12:40:00 1991
  268. X--- patchlevel.h    Tue Jan 29 12:11:30 1991
  269. X***************
  270. X*** 0 ****
  271. X--- 1,29 ----
  272. X+ /************************************************************************/
  273. X+ /*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  274. X+ /*                                    */
  275. X+ /*    Full ownership of this software, and all rights pertaining to     */
  276. X+ /*    the for-profit distribution of this software, are retained by     */
  277. X+ /*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  278. X+ /*    use this software without fee.  This software is provided "as     */
  279. X+ /*    is" without express or implied warranty.  You may redistribute     */
  280. X+ /*    this software, provided that this copyright notice is retained,    */
  281. X+ /*    and that the software is not distributed for profit.  If you     */
  282. X+ /*    wish to use this software in a profit-making venture, you must     */
  283. X+ /*    first license this code and its underlying technology from     */
  284. X+ /*    Harris Corporation.                         */
  285. X+ /*                                    */
  286. X+ /*    Bottom line: you can have this software, you can use it, you     */
  287. X+ /*    can give it away.  You just can't sell any or all parts of it     */
  288. X+ /*    without prior permission from Harris Corporation.         */
  289. X+ /************************************************************************/
  290. X+ 
  291. X+ /************************************************************************/
  292. X+ /*                                    */
  293. X+ /*    Patch        Comments                    */
  294. X+ /*      0        Initial release                    */
  295. X+ /*               comp.sources.x: Volume 11, Issues 6-10    */
  296. X+ /*                                    */
  297. X+ /*      1        Bug fixes; see README for details        */
  298. X+ /*               comp.sources.x: Volume 11, Issue ?        */
  299. X+ /*                                    */
  300. X+ /************************************************************************/
  301. X*** process.c.orig    Tue Jan 29 12:40:01 1991
  302. X--- process.c    Tue Jan 29 12:33:57 1991
  303. X***************
  304. X*** 340,350 ****
  305. X  {    char    *path;
  306. X      FILE    *f;
  307. X  
  308. X!     path = (char *) malloc(strlen(config.suffix) + 22);
  309. X      strcpy(path, "/tmp/catcher.XXXXXX");
  310. X      mktemp(path);
  311. X!     strcat(path, ".");
  312. X!     strcat(path, config.suffix);
  313. X      if ((f = fopen(path, "w")) == NULL)
  314. X         error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  315. X      else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  316. X--- 340,352 ----
  317. X  {    char    *path;
  318. X      FILE    *f;
  319. X  
  320. X!     path = (char *) malloc((config.suffix? strlen(config.suffix) : 0) + 22);
  321. X      strcpy(path, "/tmp/catcher.XXXXXX");
  322. X      mktemp(path);
  323. X!     if (config.suffix) {
  324. X!        strcat(path, ".");
  325. X!        strcat(path, config.suffix);
  326. X!        }
  327. X      if ((f = fopen(path, "w")) == NULL)
  328. X         error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  329. X      else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  330. END_OF_FILE
  331. if test 8362 -ne `wc -c <'patch'`; then
  332.     echo shar: \"'patch'\" unpacked with wrong size!
  333. fi
  334. # end of 'patch'
  335. fi
  336. echo shar: End of shell archive.
  337. exit 0
  338.  
  339.  
  340. --
  341. Dan Heller
  342. ------------------------------------------------
  343. O'Reilly && Associates               Zyrcom Inc
  344. Senior Writer                   President
  345. argv@ora.com            argv@zipcode.com
  346.